#ifndef __myapp_h__
#define __myapp_h__

#include "lws_protocol.h"
#include "cJSON.h"


#define DUMB_INCR_PROTO_RXBUF_MAX_SIZE		4096
#define DUMB_INCR_PROTO_TXBUF_MAX_SIZE      4096


typedef struct __in_json{
	cJSON* json;
	char *Action;
	cJSON *Data;
}INJSON;

#define	JSONACT_SELECT_ALL  "select * from table"
#define	JSONACT_INSERT  "insert into table"

typedef struct __user_query_session
{
  struct lws *wsi;
  char* string;
  cJSON *json;

}UQUERYSES; 

int wss_rcv_callback_2(struct lws *wsi,
					void(*minimal_destroy_message)(void*),
                    struct vhd__dumb_increment *vhd, 
                    cJSON *json_data);

struct __user_query_session *  wss_rcv_callback_3(struct lws *wsi,
                    void(*minimal_destroy_message)(void*),
                    struct vhd__dumb_increment *vhd, 
                    cJSON *json_data);

int wss_rcv_callback_3_ack(struct __user_query_session* uqueryses);

int in_json_parse(void* in, size_t len, struct __in_json* injson);
void in_json_ack(struct __in_json* injson);

#endif
